<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var progress = 0;

//回调函数

function render(time) {

    progress += 1; //修改图像的位置
    console.log(time)


    if (progress < 100) {

           //在动画没有结束前，递归渲染

           window.requestAnimationFrame(render);

    }

}


//第一帧渲染

window.requestAnimationFrame(render);
</script>
</html>
